// 获取用户设置权限
export let  getSetting=()=>{
  return new Promise((resolve,reject)=>{
    wx.getSetting({
      success:(res)=>{
        resolve(res)
      },
      fail: (err) => {
       reject(err)
      },
    })


  })
}

//打开用户设置权限页面
export let  openSetting=()=>{
  return new Promise((resolve,reject)=>{
    wx.openSetting({
      success:(res)=>{
        resolve(res)
      },
      fail: (err) => {
       reject(err)  //失败的函数
      },
    })


  })
}

//调用内置api收获地址弹框
export let  chooseAddress=()=>{
  return new Promise((resolve,reject)=>{
    wx.chooseAddress({
      success:(res)=>{
        resolve(res)
      },
      fail: (err) => {
       reject(err)
      },
    })


  })
}




